#ifndef GUI_BASE_H
#define GUI_BASE_H

#include <QPixmap>
#include <QPainter>
#include <QMouseEvent>
#include <QMutex>
#include <QObject>
#include "engine.h"

using namespace anime;

// base class for our gui objects
class GuiBase: public Interpolable
{
    Q_OBJECT

public:
    GuiBase(Engine* _engine, int _x, int _y)
    {
        engine = _engine;
        x = _x;
        y = _y;
        sx = x;
        sy = y;
        sw = 0;
        sh = 0;
        w = 0;
        h = 0;
        invalidated = true;
        mouseTracking = false;
    }

    GuiBase(Engine* _engine)
    {
        engine = _engine;
        mouseTracking = false;
        invalidated = true;
    }

    virtual ~GuiBase() {}

    virtual void Draw(QPainter& widget_painter) = 0;
    virtual void DoQWidgetOperations( void ){};

    virtual void MousePressed(QMouseEvent* event){};
    virtual void MouseReleased(QMouseEvent* event){};
    virtual void MouseMoved(QMouseEvent* event){};

    bool invalidated;
    bool mouseTracking;

    int x, y, w, h;
    int sx, sy, sw, sh;

protected:
    Engine* engine;
};

#endif // GUI_BASE_H
